-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[web] Render PlatformViews with SLOT tags. #25747
[web] Render PlatformViews with SLOT tags. #25747
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM with some nits and test fixes
lib/web_ui/test/engine/platform_views/content_manager_test.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly LGTM
_releaseOverlay(unusedViewId); | ||
_rootViews[unusedViewId]?.remove(); | ||
} | ||
disposeViews(unusedViews); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this new code will actually dispose of "disposed" views. In the old code we kept a list of views which were disposed, and then later we disposed them. In this code we are only disposing views which are trying to be composited into the scene but were never registered. In the old code we would delete disposed views whether or not they are being actively composited this frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, the thing is that in the old code this was coupled with the creation/destruction of the actual content of the platform view in the DOM.
Now, slots are "lightweight" so they can be destroyed/recreated per frame without impacting performance, and the actual platform view (with the heavy iframe) will still get destroyed when the framework signals a disposal.
Can you think of some example where this code might be leaking unused views?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…It messes with clip counts :)
…ws in a frame can be reported later by submitFrame.
… non-functioning platform view when under testing)
…plifies stuff. See what breaks!
…tead of Map<dynamic, dynamic>?.
Remove caching ability from Slots (only required for the canvaskit rendering, will be added there)
…nd the clipCount of views in the canvaskit backend.
Replace the per-platform-view shadow dom query with a top-level shadow dom query. Fixes breakage from flutter/engine#25747
Replace the per-platform-view shadow dom query with a top-level shadow dom query. Fixes breakage from flutter/engine#25747
Replace the per-platform-view shadow dom query with a top-level shadow dom query. Fixes breakage from flutter/engine#25747
Render PlatformViews in SLOT tags. To do so:
slot
(which flutter is able to move around within the render tree).content
(which is always a direct child of theflt-glass-pane
element, and contains the rendered output of a platform view factory).PlatformViewMessageHandler
class, which is configured in the engine'splatform_dispatcher.dart
. Platform Messages for Platform Views are now more easily testable.Fixes
Testing
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.